// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './route/route'
import { Input,Button,Checkbox,RadioGroup,RadioButton} from 'element-ui'
import axios from 'axios'

import Vuex from 'vuex'

import qs from 'qs'

import iView from 'iview';
import 'iview/dist/styles/iview.css';


Vue.prototype.axios=axios

Vue.prototype.qs = qs
Vue.use(Button)
Vue.use(Input)
Vue.use(Checkbox)
Vue.use(RadioGroup)
Vue.use(RadioButton)

// Vue.use(Message)

Vue.use(iView)

Vue.use(Vuex)

Vue.config.productionTip = false

// 创建store
const store = new Vuex.Store({
  // 共享数据
  state:{
    rel:[],
    its:{}
  },
  mutations:{
    SET_ITEM(state,obj){
      state.its  = obj
      console.log(state.its);
    },
    SET_ITEMS(state,obj){
      state.rel.push(obj)
      console.log(state.rel);
    }
  },
  getters: {
        man: state => {
          console.log(state.its);
            return state.its
        },
        fod: state =>{
          return state.rel
        }
    }

})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  template: '<App/>',
  store,
  components: { App },
  // 把路由对象挂载在实例上
  router
})
